<template>
  <div>
    <!-- 姓名、年龄、电话 -->
    <section class="info title">
      <span class="required"></span>
      姓名：<input type="text" v-model="baseInfo.name">
      年龄：<input type="text" v-model="baseInfo.age">岁<br/>
      电话：<input type="text" v-model="baseInfo.phone">
    </section>
  </div>
</template>

<script>
export default {
  name: 'info',
  model: {
    prop: 'baseInfo',
    event: 'change'
  },
  props: ['baseInfo']
}
</script>

<style lang="less" scoped>
.title {
  font-size: 15px;
  color: #444444;
  font-weight: bold;
  line-height: 20px;
  position: relative;
}
// info
.info {
  > span {
    // 是否必填
    &.required {
      position: absolute;
      left: -10px;
      color: red;
      font-weight: bold;
      &::after {
        content: "*";
      }
    }
  }
  > input {
    padding: 3px;
    background-color: transparent;
    border: solid 1px transparent;
    border-bottom: solid 1px #cdcdcd;
    outline: none;
    &:hover,
    &:focus {
      border: solid 1px #cdcdcd;
    }

    &:nth-of-type(1) {
      width: 63px;
    }

    &:nth-of-type(2) {
      width: 21px;
    }

    &:nth-of-type(3) {
      margin-top: 10px;
      width: 84px;
    }
  }
}
</style>